package com.eascs.crm.nsEditDetail.service;

import javax.inject.Inject;

import org.springframework.stereotype.Service;

import com.eascs.crm.nsEditDetail.dao.NsEditDetailDao;
import com.eascs.crm.nsEditDetail.entity.AssetsTotInfoEntity;

@Service
public class AssetsTotInfoService {

	@Inject
	NsEditDetailDao nsEditDetailDao;

	public AssetsTotInfoEntity findAssetsTotInfoByLoanapplyId(String loanapplyId) {
		return nsEditDetailDao.findEntity("select * from assets_tot_info where loanapply_no = ?",
				AssetsTotInfoEntity.class, loanapplyId);
	}

	public boolean assetsSave(AssetsTotInfoEntity assets) {
		return nsEditDetailDao.insert(assets) > 0 ? true : false;
	}

	public boolean assetsUpdate(AssetsTotInfoEntity assets) {
		return nsEditDetailDao.updateById(assets) > 0 ? true : false;
	}

}
